<% form_for(@record) do |f| %>
	<div class="toolbar">
		<h1><%=@name%></h1>
		<a class="cancel" href="#">Cancel</a>

	</div>
        <%= f.error_messages %>
	<ul>
	<% @record.get_headers.each do |a| %>
          <%=view_attr_on_iphone(a,f)%>
        <% end %>
	<div id="submitbutton" class="whiteButton submit">Create <%@name%></div>
        </ul>
<% end %>
<!--form action="/movies" class="new_movie" id="new_movie" method="post"-->
   <script type="text/javascript" charset="utf-8">
                function submitForm(e, callback){


            var $form = (typeof(e)==='string') ? $(e) : $(e.target);

            if ($form.length) {
                $.ajax({
                    url: $form.attr('action'),
                    data: $form.serialize(),
                    type: $form.attr('method'),
                    success: function (data, textStatus) {
                        jQT.goBack();
                    },
                    error: function (data) {
                      $("#errorExplanation").html("error encontered");
                     }
                });

            }
                   return false;
                }
                $('.new_<%=@name%>').submit(submitForm);
                //$('.whiteButton').click(submitForm);

        </script>